﻿package controllers.read;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import rbac.models.User;

import models.Demandinfo;
import models.Proofrinfo;
import models.Stzd;
import models.Sysinfo;

import com.et.mvc.BinaryView;
import com.et.mvc.JsonView;
import com.et.mvc.MultipartFile;
import com.et.mvc.TextView;
import com.et.mvc.View;

import com.et.mvc.filter.BeforeFilter;
import com.et.mvc.filter.BeforeFilters;

import controllers.ApplicationController;
import java.text.SimpleDateFormat;

public class TodayinfoController extends ApplicationController {
	
	public void index() throws Exception{
		String cond = "passflag = 0 and totop = 1 and totopdate >getdate()";
		long i = Sysinfo.count(Sysinfo.class, cond, null);
		request.setAttribute("gg", i);
		
		User user = (User) rbac.getCurrentUser();
		
		cond = "editdate > getdate()-1";
		
		i = Demandinfo.count(Demandinfo.class, cond, null);
		request.setAttribute("cq", i);
		
		cond = " PF_UnitName = '" +user.getDepartment().getSxname()+ "'";
		i = Proofrinfo.count(Proofrinfo.class, cond, null);
		request.setAttribute("jd", i);
		
		cond = " valid_time < GETDATE()";
		i = Demandinfo.count(Demandinfo.class, cond, null);
		request.setAttribute("gq", i);
		
	}
	
	
	
}
